Class
handlerId!
2717040!
Unclassified!
0Str! !
#categories!
Unclassified! !
removeAttributeAt:ifAbsent:!
2722136!
Unclassified!
0Str:[]:Cltn[Str]! !
hasDualHandler!
2717198!
Unclassified!
0Boolean! !
indexDict!
2717343!
Unclassified!
0Dictionary[Symbol,Cltn[Str]]! !
isPersistent!
2719527!
Unclassified!
0Boolean! !
newExtension!
2720740!
Unclassified!
0Str! !
#extensionsAreSubtypes!
true! !
mirror:!
2720597!
Unclassified!
0Mirror:! !
dualHandler!
2716164!
Unclassified!
0Self! !
backupExtension!
2714069!
Unclassified!
0Str! !
#group!
reflection! !
setName:!
2723318!
Unclassified!
0Str:! !
sourceDirectory!
2723570!
Unclassified!
0FilePath! !
#branded!
true! !
storeIndexFile!
2723741!
Unclassified!
0! !
booleanAttributeAt:put:!
2714496!
Unclassified!
0Str:Boolean:! !
metaExtension!
2720315!
Unclassified!
0Str! !
parseIndexFile!
2720881!
Unclassified!
0! !
dualHandler:!
2716490!
Unclassified!
0:Self! !
indexDict:!
2717654!
Unclassified!
0Dictionary[Symbol,Cltn[Str]]:! !
addSectionToChangeLog:!
2713085!
Unclassified!
0[WriteStream,^Int]:Int! !
indexFileName!
2718658!
Unclassified!
0Str! !
booleanAttributeAt:!
2714213!
Unclassified!
0Str:Boolean! !
makeBackupIndex!
2719689!
Unclassified!
0! !
#superclassTypeString!
NotifyingObject mixin |> Object! !
convertFromFilename:!
2714878!
Unclassified!
0Str:Str! !
indexFile!
2717825!
Unclassified!
0FilePath! !
#revision!
$Revision: 1.9 $! !
attributeAt:!
2713292!
Unclassified!
0Str:OrdCltn[Str]! !
#classVariableString!
ActiveHandlers ChangeLog <CharWriteStream> RawChangeLog <ExternalReadWriteStream> SourceDirectory InitialChangeLogSize <Int>! !
#instanceVariableString!
mirror dualHandler indexFile indexDict isNewIndex ! !
printOn:!
2721902!
Unclassified!
0Stream:! !
isMeta!
2718970!
Unclassified!
0Boolean! !
removeIndex!
2722374!
Unclassified!
0! !
uniqueAttributeAt:!
2724368!
Unclassified!
0Str:Str! !
attributeAt:put:!
2713514!
Unclassified!
0Str:OrdCltn[Str]:! !
isNewIndex:!
2719375!
Unclassified!
0Boolean:! !
#subtype!
true! !
convertToFilename:!
2715567!
Unclassified!
0Str:Str! !
#comment!
This class manages the source code database. 
Subclasses are specialized for specific source constructs.
An instance of such a subclass manages the source code for a particular definition. For example,
a MixinSourceHandler handles source code for a partiular mixin.

The database usually resides in the subdirectory 'source' of the strongtalk directory. If you wish to have
it elsewhere, set the environment variable StrongtalkSourceDir.

The database contains an identification file, strongtalksource.id. This file consists of two "chunks"
in file in format. The first chunk is a path, that specifies what binary the source database is
associated with. The second chunk is the size of the file strongtalkchange.log, which contains the
entire source code history of the system from last creation.

The source DB also includes files for every class and metaclass in the system. If the class is named X, then its
instance side is represented in the file X in the source directory, and its class side is represented in the file X.class.

Whenever a change is made to the
source code, several things happen:

0. The binary representation IN MEMORY is modified to match the changed source.
1. If this is a new definition X, then a file X.new is created in the source directory.
2. Otherwise, if this is the first change to this definition  in the current session, then:
a. The original source file for the definition X being modified is backed up as X.bak.
b.  The original source code, in file in format, is appended to the restore log, strongtalkrestore.log.
3. The source file for X is modified accordingly.
4. The change is appended to the change log, strongtalkchange.log.

When the system is saved, the binary on disk is rewritten to reflect the memory image of the program.
All the .bak files are removed, and all the .new files have their .new suffix removed, making the new source 
permanent. In addition, a save comment is written to the change log, and the restore log is deleted. 
Finally, the id file is regenerated: it will now contain the path
of the binary that was used in this session, and the size of the change log just after the save.

Using this information, the system can detect if the change log size is greater than the size listed in the id file. This 
indicates unsaved source changes. The system then generates a warning that the source DB is inconsistent with 
the binary. The user is then asked to resync the two. This is accomplished by :

a. Rolling back the change log to the index
indicated by the id file.  
b. For all files X.bak, remove the file X and then rename X.bak to X.
c. Remove all .new files.

Any lost changes can be filed in from the restore log.

Other than the logs and id file, the source DB consists of files representing the code in individual classes and
metaclasses. These rely heavily on indices into the change log, and are known as index files. Every instance
of a source handler has its own index file. The index files are represented in file in format, using chunks.

For every construct, the appropriate source handler defines a series of attributes. The index file then encodes
these attributes. Some attributes are listed directly in the index file, while others point at an index in the change
log. As a rule, if an attribute needs to be available quickly, it is encoded directly into the index file. For example,
category names and type signatures are needed by browsers that have to display this information, even if
no method bodies are being viewed. Type information is also needed by the type checker. Therefore, this
data is directly available in the index file. On the other hand, method bodies are only needed when a browser
opens a view on a method. In that case, we can afford to look it up in the change log, so the index file contains
only a number, which is a character offser into the change log where the method body can be found.

 (c) 1995-1997 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 
Use and distribution of this software is subject to the terms of the attached source license.! !
#abstract!
false! !
isNewIndex!
2719121!
Unclassified!
0Boolean! !
mirror!
2720459!
Unclassified!
0Mirror! !
changeLog!
2714721!
Unclassified!
0FilePath! !
removeIndexFile!
2722991!
Unclassified!
0! !
flush!
2716643!
Unclassified!
0! !
indexFile:!
2718505!
Unclassified!
0FilePath:! !
